{layout name="admin/layout" /}
<form id="form" action="{:url('bestbao/admin.cost/config',['miniapp_id' => $miniapp_id])}">
    <table class="formtable">
        <tr>
            <th>类型:</th>
            <td>
                <select class="select w180" datatype="*" name="type">
                    <option value="0" {if $info.type == 0}selected{/if}>付费</option>
                    <option value="1" {if $info.type == 1}selected{/if}>买断</option>
                </select>
            </td>
        </tr>
        <tr id="price" style="{if $info.type == 1}display:none;{/if}"><th>价格(￥):</th><td><input class="input w180" type="text" name="price" value="{$info.price}" /> 元</td></tr>
        <tr><th></th><td><input type="submit" value="确定" class="button submit" /><input type="reset" value="重置" class="button button-blank"/></td></tr>
    </table>
</div>
</form>
<script type="text/javascript">
Do('base','layer','form',function(){
    $('#form').isForm();
    $('.select').change(function () {
        if($(this).val() == 1){
            $('#price').hide();
            $('input[name=price]').val(0);
        }else{
            $('#price').show();
        }
    })
})
</script>